function toString(type) {
    return Object.prototype.toString.call(type);
}

function isObject(obj) {
    return typeof obj === 'object' && toString(obj) === "[object Object]";
}

/**
 * 转变类似标签上css style语法
 * 
 * @param {String} str 
 * @param {String} [splitopr = ;] 
 * 
 * @example
 * 'translateX:100;' => [['translateX', '100']]
 * 
 * @return {Array} arr
 */
export function transformStylelikeExp(str, splitopr = ";") {
    if (!str) {
        return [];
    }
    if (str.endsWith(splitopr)) {
        str = str.slice(0, str.length - 1);
    }    
    let arr = str.split(splitopr);
    arr = arr.map(v => {
        return  v.trim().split(":").map(s => s.trim())
    });
    return arr;
}
